home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 32 / Amiga Format AFCD32 (Nov 1998, Issue 117).iso / -seriously_amiga- / programming / other / hrtmon / assembler.s < prev    next >
Text File  |  1998-08-10  |  1KB  |  60 lines

  1.  
  2.     XDEF _DoJSR
  3.     XDEF _RemHRTmon
  4.     XDEF _BootSum
  5.  
  6. ;int BootSum(char *BootBlockAddress);
  7.  
  8. _BootSum    movem.l    d1-a6,-(a7)
  9.         move.l    15*4(a7),a0    ;get BootBlockAddress
  10.         moveq    #0,d0
  11.         move.w    #512*2/4-1,d1
  12. .add        add.l    (a0)+,d0
  13.         bcc.b    .noc
  14.         addq.l    #1,d0
  15. .noc        dbf    d1,.add
  16.         not.l    d0
  17.         movem.l    (a7)+,d1-a6
  18.         rts
  19.  
  20. ;void DoJSR(unsigned long address);
  21.  
  22. _DoJSR        movem.l    d0-a6,-(a7)
  23.         move.l    16*4(a7),a0    ;get parameter
  24.         jsr    (a0)
  25.         movem.l    (a7)+,d0-a6
  26.         rts
  27.  
  28. ;int RemHRTmon();
  29. ;Check if HRTmon already installed if YES remove it and FreeMem.
  30. ;return TRUE if HRTmon deinstalled
  31. ;return FALSE if HRTmon not located
  32.  
  33. _RemHRTmon    movem.l    d1-a6,-(a7)
  34.         move.l    $4.w,a6
  35.         lea.l    super(pc),a5
  36.         jsr    -30(a6)
  37.         tst.l    d7
  38.         beq.b    .noHRT
  39.         jsr    16(a4)            ;remove
  40. .noHRT        move.l    d7,d0
  41.         movem.l    (a7)+,d1-a6
  42.         rts
  43.  
  44. super        moveq    #0,d7
  45.         move.l    $10.w,a3
  46.         move.l    #.illegal,$10.w
  47.         movec    VBR,a0
  48. .return        move.l    $7c(a0),a0
  49.         cmp.l    #'HRT!',-4(a0)
  50.         bne.b    .noHRT
  51.         moveq    #-1,d7
  52.         move.l    -8(a0),a4
  53. .noHRT        move.l    a3,$10.w
  54.         rte
  55.  
  56.  
  57. .illegal:    sub.l    a0,a0
  58.         move.l    #.return,2(a7)
  59.         rte
  60.